﻿<div class="content-wrapper">
    <section class="content-header">
        <h1>
            故障查看
            <small>站点故障月对比</small>
        </h1>
        <ol class="breadcrumb">
            <li><a href="#"><i class="fa fa-dashboard"></i> 首页</a></li>
            <li><a href="#">故障查看</a></li>
            <li class="active">站点故障月对比</li>
        </ol>
    </section>
    <section class="content">
        <div class="row">
            <div class="col-xs-12">
                <div class="box">
                    <div class="box-body">
                        <div class="input-group">
                            <span class="input-group-addon">年份</span>
                            <input type="text" v-model="datemin" ref="datemin" id="datemin" class="form-control" style="width:120px;">
                            <input type="hidden" v-model="datemax" ref="datemax" id="datemax" class="form-control" style="width:120px;">
                        </div>
                        <div id="toolbar" class="btn-group">
                            <button id="btn_search" v-on:click="searchL" type="button" class="btn btn-default">
                                <span class="glyphicon glyphicon-search" aria-hidden="true"></span>查询
                            </button>
                        </div>
                        <table id="bootstraptable" class="table table-bordered text-nowrap table-hover"></table>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-xs-12">
                <div class="box">
                    <div class="box-body">
                        <p>故障数</p>
                        <div id="failureNum" style="width:100%;height:300px;"></div>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-xs-12">
                <div class="box">
                    <div class="box-body">
                        <p>故障时长(Min)</p>
                        <div id="failureTime" style="width:100%;height:300px"></div>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-xs-12">
                <div class="box">
                    <div class="box-body">
                        <p>确认时长(Min)</p>
                        <div id="confirmTime" style="width:100%;height:300px"></div>
                    </div>
                </div>
            </div>
        </div>
    </section>
</div>
@section styles{
    <style>
        .fixed-table-pagination .pagination-detail, .fixed-table-pagination div.pagination {
            display: none
        }
    </style>
}
@section scripts{
    <script type="text/javascript">
        var app = new Vue({
            el: '#app',
            data: {
                datemin: '',
                datemax: '',
                url: '/DeviceFailureMonth/MonthFailureEchart',
                sourceFailureNumData: [],
                sourceDurationMinData: [],
                sourceConfirmTimeData: []
            },
            mounted: function () {
                var _self = this;
                _self.$nextTick(function () {
                    //显示active
                    _self.$refs.DeviceFailureMonth.parentNode.parentNode.classList.add("active");
                    _self.$refs.DeviceFailureMonth.classList.add("active");

                    _self.datemin = yui.getYear();
                    $('#datemin').datetimepicker({
                        format: 'yyyy',
                        startView:4,
                        minView: 4,
                        autoclose: true,
                        language: "zh-CN"
                    });
                    setTimeout(function () {
                        _self.loadL();
                        //setDataCardView("#bootstraptable");
                        _self.echartFailureCountL();
                        _self.echartDurationMinL();
                        _self.echartConfirmTimeL();
                        //$("div[class='pull-right search']")[0].children[0].setAttribute("placeholder", "终端名称");
                    }, 500);
                });
            },
            methods: {
                loadL: function () {
                    _self = this;
                    var obj = [
                    [
                        {
                        field: 'no',
                        title: '#',
                        align: 'center',
                        rowspan:2,
                        formatter: function (value, row, index) {
                            var options = $('#bootstraptable').bootstrapTable('getOptions');
                            return index + 1;
                        }
                    }, {
                        field: 'ClientName',
                        title: '站点名称',
                        align: 'center',
                        rowspan:2,
                        sortable: true
                    }, {
                        title: '1月',
                        align: 'center',
                        colspan:3
                    }, {
                        title: '2月',
                        align: 'center',
                        colspan:3
                    }, {
                        title: '3月',
                        align: 'center',
                        colspan:3
                    }, {
                        title: '4月',
                        align: 'center',
                        colspan:3
                    }, {
                        title: '5月',
                        align: 'center',
                        colspan:3
                    }, {
                        title: '6月',
                        align: 'center',
                        colspan:3
                    }, {
                        title: '7月',
                        align: 'center',
                        colspan:3
                    }, {
                        title: '8月',
                        align: 'center',
                        colspan:3
                    }, {
                        title: '9月',
                        align: 'center',
                        colspan:3
                    }, {
                        title: '10月',
                        align: 'center',
                        colspan:3
                    }, {
                        title: '11月',
                        align: 'center',
                        colspan:3
                    }, {
                        title: '12月',
                        align: 'center',
                        colspan:3
                    }
                    ],
                    [
                    {
                        field: 'FailureCount1',
                        title: '报警数',
                        align: 'center'
                    }, {
                        field: 'DurationMin1',
                        align: 'center',
                        title: '报警时长',
                        formatter: function (value, row, index) {
                            var Failure_time = parseInt(row.DurationMin1);
                            var result = "";
                            var day = 0;
                            var hour = 0;
                            var minute = 0;

                            if (Failure_time >= 1440) {
                                day = parseInt(Failure_time / 1440);
                                hour = parseInt((Failure_time - day * 1440) / 60);
                                minute = Failure_time - (day * 1440 + hour * 60);
                                result = "<span>" + day + "天" + hour + "小时" + minute + "分钟</span>";

                            } else if (Failure_time >= 60) {
                                hour = parseInt(Failure_time / 60);
                                minute = Failure_time - hour * 60;
                                result = "<span>" + hour + "小时" + minute + "分钟</span>";
                            }
                            else {
                                minute = Failure_time;
                                result = "<span>" + minute + "分钟</span>";
                            }
                            return result;
                        }
                    }, {
                        field: 'ConfirmTime1',
                        title: '确认时长',
                        align: 'center',
                        formatter: function (value, row, index) {
                            var confirm_time = parseInt(row.ConfirmTime1);
                            var result = "";
                            var day = 0;
                            var hour = 0;
                            var minute = 0;

                            if (confirm_time >= 1440) {
                                day = parseInt(confirm_time / 1440);
                                hour = parseInt((confirm_time - day * 1440) / 60);
                                minute = confirm_time - (day * 1440 + hour * 60);
                                result = "<span>" + day + "天" + hour + "小时" + minute + "分钟</span>";

                            } else if (confirm_time >= 60) {
                                hour = parseInt(confirm_time / 60);
                                minute = confirm_time - hour * 60;
                                result = "<span>" + hour + "小时" + minute + "分钟</span>";
                            }
                            else {
                                minute = confirm_time;
                                result = "<span>" + minute + "分钟</span>";
                            }
                            return result;
                        }
                        },{
                        field: 'FailureCount2',
                        title: '报警数',
                        align: 'center'
                    }, {
                        field: 'DurationMin2',
                        align: 'center',
                        title: '报警时长',
                        formatter: function (value, row, index) {
                            var Failure_time = parseInt(row.DurationMin2);
                            var result = "";
                            var day = 0;
                            var hour = 0;
                            var minute = 0;

                            if (Failure_time >= 1440) {
                                day = parseInt(Failure_time / 1440);
                                hour = parseInt((Failure_time - day * 1440) / 60);
                                minute = Failure_time - (day * 1440 + hour * 60);
                                result = "<span>" + day + "天" + hour + "小时" + minute + "分钟</span>";

                            } else if (Failure_time >= 60) {
                                hour = parseInt(Failure_time / 60);
                                minute = Failure_time - hour * 60;
                                result = "<span>" + hour + "小时" + minute + "分钟</span>";
                            }
                            else {
                                minute = Failure_time;
                                result = "<span>" + minute + "分钟</span>";
                            }
                            return result;
                        }
                    }, {
                        field: 'ConfirmTime2',
                        title: '确认时长',
                        align: 'center',
                        formatter: function (value, row, index) {
                            var confirm_time = parseInt(row.ConfirmTime2);
                            var result = "";
                            var day = 0;
                            var hour = 0;
                            var minute = 0;

                            if (confirm_time >= 1440) {
                                day = parseInt(confirm_time / 1440);
                                hour = parseInt((confirm_time - day * 1440) / 60);
                                minute = confirm_time - (day * 1440 + hour * 60);
                                result = "<span>" + day + "天" + hour + "小时" + minute + "分钟</span>";

                            } else if (confirm_time >= 60) {
                                hour = parseInt(confirm_time / 60);
                                minute = confirm_time - hour * 60;
                                result = "<span>" + hour + "小时" + minute + "分钟</span>";
                            }
                            else {
                                minute = confirm_time;
                                result = "<span>" + minute + "分钟</span>";
                            }
                            return result;
                        }
                        }, {
                            field: 'FailureCount3',
                            title: '报警数',
                            align: 'center'
                        }, {
                            field: 'DurationMin3',
                            align: 'center',
                            title: '报警时长',
                            formatter: function (value, row, index) {
                                var Failure_time = parseInt(row.DurationMin3);
                                var result = "";
                                var day = 0;
                                var hour = 0;
                                var minute = 0;

                                if (Failure_time >= 1440) {
                                    day = parseInt(Failure_time / 1440);
                                    hour = parseInt((Failure_time - day * 1440) / 60);
                                    minute = Failure_time - (day * 1440 + hour * 60);
                                    result = "<span>" + day + "天" + hour + "小时" + minute + "分钟</span>";

                                } else if (Failure_time >= 60) {
                                    hour = parseInt(Failure_time / 60);
                                    minute = Failure_time - hour * 60;
                                    result = "<span>" + hour + "小时" + minute + "分钟</span>";
                                }
                                else {
                                    minute = Failure_time;
                                    result = "<span>" + minute + "分钟</span>";
                                }
                                return result;
                            }
                        }, {
                            field: 'ConfirmTime3',
                            title: '确认时长',
                            align: 'center',
                            formatter: function (value, row, index) {
                                var confirm_time = parseInt(row.ConfirmTime3);
                                var result = "";
                                var day = 0;
                                var hour = 0;
                                var minute = 0;

                                if (confirm_time >= 1440) {
                                    day = parseInt(confirm_time / 1440);
                                    hour = parseInt((confirm_time - day * 1440) / 60);
                                    minute = confirm_time - (day * 1440 + hour * 60);
                                    result = "<span>" + day + "天" + hour + "小时" + minute + "分钟</span>";

                                } else if (confirm_time >= 60) {
                                    hour = parseInt(confirm_time / 60);
                                    minute = confirm_time - hour * 60;
                                    result = "<span>" + hour + "小时" + minute + "分钟</span>";
                                }
                                else {
                                    minute = confirm_time;
                                    result = "<span>" + minute + "分钟</span>";
                                }
                                return result;
                            }
                        }, {
                            field: 'FailureCount4',
                            title: '报警数',
                            align: 'center'
                        }, {
                            field: 'DurationMin4',
                            align: 'center',
                            title: '报警时长',
                            formatter: function (value, row, index) {
                                var Failure_time = parseInt(row.DurationMin4);
                                var result = "";
                                var day = 0;
                                var hour = 0;
                                var minute = 0;

                                if (Failure_time >= 1440) {
                                    day = parseInt(Failure_time / 1440);
                                    hour = parseInt((Failure_time - day * 1440) / 60);
                                    minute = Failure_time - (day * 1440 + hour * 60);
                                    result = "<span>" + day + "天" + hour + "小时" + minute + "分钟</span>";

                                } else if (Failure_time >= 60) {
                                    hour = parseInt(Failure_time / 60);
                                    minute = Failure_time - hour * 60;
                                    result = "<span>" + hour + "小时" + minute + "分钟</span>";
                                }
                                else {
                                    minute = Failure_time;
                                    result = "<span>" + minute + "分钟</span>";
                                }
                                return result;
                            }
                        }, {
                            field: 'ConfirmTime4',
                            title: '确认时长',
                            align: 'center',
                            formatter: function (value, row, index) {
                                var confirm_time = parseInt(row.ConfirmTime4);
                                var result = "";
                                var day = 0;
                                var hour = 0;
                                var minute = 0;

                                if (confirm_time >= 1440) {
                                    day = parseInt(confirm_time / 1440);
                                    hour = parseInt((confirm_time - day * 1440) / 60);
                                    minute = confirm_time - (day * 1440 + hour * 60);
                                    result = "<span>" + day + "天" + hour + "小时" + minute + "分钟</span>";

                                } else if (confirm_time >= 60) {
                                    hour = parseInt(confirm_time / 60);
                                    minute = confirm_time - hour * 60;
                                    result = "<span>" + hour + "小时" + minute + "分钟</span>";
                                }
                                else {
                                    minute = confirm_time;
                                    result = "<span>" + minute + "分钟</span>";
                                }
                                return result;
                            }
                        }, {
                            field: 'FailureCount5',
                            title: '报警数',
                            align: 'center'
                        }, {
                            field: 'DurationMin5',
                            align: 'center',
                            title: '报警时长',
                            formatter: function (value, row, index) {
                                var Failure_time = parseInt(row.DurationMin5);
                                var result = "";
                                var day = 0;
                                var hour = 0;
                                var minute = 0;

                                if (Failure_time >= 1440) {
                                    day = parseInt(Failure_time / 1440);
                                    hour = parseInt((Failure_time - day * 1440) / 60);
                                    minute = Failure_time - (day * 1440 + hour * 60);
                                    result = "<span>" + day + "天" + hour + "小时" + minute + "分钟</span>";

                                } else if (Failure_time >= 60) {
                                    hour = parseInt(Failure_time / 60);
                                    minute = Failure_time - hour * 60;
                                    result = "<span>" + hour + "小时" + minute + "分钟</span>";
                                }
                                else {
                                    minute = Failure_time;
                                    result = "<span>" + minute + "分钟</span>";
                                }
                                return result;
                            }
                        }, {
                            field: 'ConfirmTime5',
                            title: '确认时长',
                            align: 'center',
                            formatter: function (value, row, index) {
                                var confirm_time = parseInt(row.ConfirmTime5);
                                var result = "";
                                var day = 0;
                                var hour = 0;
                                var minute = 0;

                                if (confirm_time >= 1440) {
                                    day = parseInt(confirm_time / 1440);
                                    hour = parseInt((confirm_time - day * 1440) / 60);
                                    minute = confirm_time - (day * 1440 + hour * 60);
                                    result = "<span>" + day + "天" + hour + "小时" + minute + "分钟</span>";

                                } else if (confirm_time >= 60) {
                                    hour = parseInt(confirm_time / 60);
                                    minute = confirm_time - hour * 60;
                                    result = "<span>" + hour + "小时" + minute + "分钟</span>";
                                }
                                else {
                                    minute = confirm_time;
                                    result = "<span>" + minute + "分钟</span>";
                                }
                                return result;
                            }
                        }, {
                            field: 'FailureCount6',
                            title: '报警数',
                            align: 'center'
                        }, {
                            field: 'DurationMin6',
                            align: 'center',
                            title: '报警时长',
                            formatter: function (value, row, index) {
                                var Failure_time = parseInt(row.DurationMin6);
                                var result = "";
                                var day = 0;
                                var hour = 0;
                                var minute = 0;

                                if (Failure_time >= 1440) {
                                    day = parseInt(Failure_time / 1440);
                                    hour = parseInt((Failure_time - day * 1440) / 60);
                                    minute = Failure_time - (day * 1440 + hour * 60);
                                    result = "<span>" + day + "天" + hour + "小时" + minute + "分钟</span>";

                                } else if (Failure_time >= 60) {
                                    hour = parseInt(Failure_time / 60);
                                    minute = Failure_time - hour * 60;
                                    result = "<span>" + hour + "小时" + minute + "分钟</span>";
                                }
                                else {
                                    minute = Failure_time;
                                    result = "<span>" + minute + "分钟</span>";
                                }
                                return result;
                            }
                        }, {
                            field: 'ConfirmTime6',
                            title: '确认时长',
                            align: 'center',
                            formatter: function (value, row, index) {
                                var confirm_time = parseInt(row.ConfirmTime6);
                                var result = "";
                                var day = 0;
                                var hour = 0;
                                var minute = 0;

                                if (confirm_time >= 1440) {
                                    day = parseInt(confirm_time / 1440);
                                    hour = parseInt((confirm_time - day * 1440) / 60);
                                    minute = confirm_time - (day * 1440 + hour * 60);
                                    result = "<span>" + day + "天" + hour + "小时" + minute + "分钟</span>";

                                } else if (confirm_time >= 60) {
                                    hour = parseInt(confirm_time / 60);
                                    minute = confirm_time - hour * 60;
                                    result = "<span>" + hour + "小时" + minute + "分钟</span>";
                                }
                                else {
                                    minute = confirm_time;
                                    result = "<span>" + minute + "分钟</span>";
                                }
                                return result;
                            }
                        }, {
                            field: 'FailureCount7',
                            title: '报警数',
                            align: 'center'
                        }, {
                            field: 'DurationMin7',
                            align: 'center',
                            title: '报警时长',
                            formatter: function (value, row, index) {
                                var Failure_time = parseInt(row.DurationMin7);
                                var result = "";
                                var day = 0;
                                var hour = 0;
                                var minute = 0;

                                if (Failure_time >= 1440) {
                                    day = parseInt(Failure_time / 1440);
                                    hour = parseInt((Failure_time - day * 1440) / 60);
                                    minute = Failure_time - (day * 1440 + hour * 60);
                                    result = "<span>" + day + "天" + hour + "小时" + minute + "分钟</span>";

                                } else if (Failure_time >= 60) {
                                    hour = parseInt(Failure_time / 60);
                                    minute = Failure_time - hour * 60;
                                    result = "<span>" + hour + "小时" + minute + "分钟</span>";
                                }
                                else {
                                    minute = Failure_time;
                                    result = "<span>" + minute + "分钟</span>";
                                }
                                return result;
                            }
                        }, {
                            field: 'ConfirmTime7',
                            title: '确认时长',
                            align: 'center',
                            formatter: function (value, row, index) {
                                var confirm_time = parseInt(row.ConfirmTime7);
                                var result = "";
                                var day = 0;
                                var hour = 0;
                                var minute = 0;

                                if (confirm_time >= 1440) {
                                    day = parseInt(confirm_time / 1440);
                                    hour = parseInt((confirm_time - day * 1440) / 60);
                                    minute = confirm_time - (day * 1440 + hour * 60);
                                    result = "<span>" + day + "天" + hour + "小时" + minute + "分钟</span>";

                                } else if (confirm_time >= 60) {
                                    hour = parseInt(confirm_time / 60);
                                    minute = confirm_time - hour * 60;
                                    result = "<span>" + hour + "小时" + minute + "分钟</span>";
                                }
                                else {
                                    minute = confirm_time;
                                    result = "<span>" + minute + "分钟</span>";
                                }
                                return result;
                            }
                        }, {
                            field: 'FailureCount8',
                            title: '报警数',
                            align: 'center'
                        }, {
                            field: 'DurationMin8',
                            align: 'center',
                            title: '报警时长',
                            formatter: function (value, row, index) {
                                var Failure_time = parseInt(row.DurationMin8);
                                var result = "";
                                var day = 0;
                                var hour = 0;
                                var minute = 0;

                                if (Failure_time >= 1440) {
                                    day = parseInt(Failure_time / 1440);
                                    hour = parseInt((Failure_time - day * 1440) / 60);
                                    minute = Failure_time - (day * 1440 + hour * 60);
                                    result = "<span>" + day + "天" + hour + "小时" + minute + "分钟</span>";

                                } else if (Failure_time >= 60) {
                                    hour = parseInt(Failure_time / 60);
                                    minute = Failure_time - hour * 60;
                                    result = "<span>" + hour + "小时" + minute + "分钟</span>";
                                }
                                else {
                                    minute = Failure_time;
                                    result = "<span>" + minute + "分钟</span>";
                                }
                                return result;
                            }
                        }, {
                            field: 'ConfirmTime8',
                            title: '确认时长',
                            align: 'center',
                            formatter: function (value, row, index) {
                                var confirm_time = parseInt(row.ConfirmTime8);
                                var result = "";
                                var day = 0;
                                var hour = 0;
                                var minute = 0;

                                if (confirm_time >= 1440) {
                                    day = parseInt(confirm_time / 1440);
                                    hour = parseInt((confirm_time - day * 1440) / 60);
                                    minute = confirm_time - (day * 1440 + hour * 60);
                                    result = "<span>" + day + "天" + hour + "小时" + minute + "分钟</span>";

                                } else if (confirm_time >= 60) {
                                    hour = parseInt(confirm_time / 60);
                                    minute = confirm_time - hour * 60;
                                    result = "<span>" + hour + "小时" + minute + "分钟</span>";
                                }
                                else {
                                    minute = confirm_time;
                                    result = "<span>" + minute + "分钟</span>";
                                }
                                return result;
                            }
                        }, {
                            field: 'FailureCount9',
                            title: '报警数',
                            align: 'center'
                        }, {
                            field: 'DurationMin9',
                            align: 'center',
                            title: '报警时长',
                            formatter: function (value, row, index) {
                                var Failure_time = parseInt(row.DurationMin9);
                                var result = "";
                                var day = 0;
                                var hour = 0;
                                var minute = 0;

                                if (Failure_time >= 1440) {
                                    day = parseInt(Failure_time / 1440);
                                    hour = parseInt((Failure_time - day * 1440) / 60);
                                    minute = Failure_time - (day * 1440 + hour * 60);
                                    result = "<span>" + day + "天" + hour + "小时" + minute + "分钟</span>";

                                } else if (Failure_time >= 60) {
                                    hour = parseInt(Failure_time / 60);
                                    minute = Failure_time - hour * 60;
                                    result = "<span>" + hour + "小时" + minute + "分钟</span>";
                                }
                                else {
                                    minute = Failure_time;
                                    result = "<span>" + minute + "分钟</span>";
                                }
                                return result;
                            }
                        }, {
                            field: 'ConfirmTime9',
                            title: '确认时长',
                            align: 'center',
                            formatter: function (value, row, index) {
                                var confirm_time = parseInt(row.ConfirmTime9);
                                var result = "";
                                var day = 0;
                                var hour = 0;
                                var minute = 0;

                                if (confirm_time >= 1440) {
                                    day = parseInt(confirm_time / 1440);
                                    hour = parseInt((confirm_time - day * 1440) / 60);
                                    minute = confirm_time - (day * 1440 + hour * 60);
                                    result = "<span>" + day + "天" + hour + "小时" + minute + "分钟</span>";

                                } else if (confirm_time >= 60) {
                                    hour = parseInt(confirm_time / 60);
                                    minute = confirm_time - hour * 60;
                                    result = "<span>" + hour + "小时" + minute + "分钟</span>";
                                }
                                else {
                                    minute = confirm_time;
                                    result = "<span>" + minute + "分钟</span>";
                                }
                                return result;
                            }
                        }, {
                            field: 'FailureCount10',
                            title: '报警数',
                            align: 'center'
                        }, {
                            field: 'DurationMin10',
                            align: 'center',
                            title: '报警时长',
                            formatter: function (value, row, index) {
                                var Failure_time = parseInt(row.DurationMin10);
                                var result = "";
                                var day = 0;
                                var hour = 0;
                                var minute = 0;

                                if (Failure_time >= 1440) {
                                    day = parseInt(Failure_time / 1440);
                                    hour = parseInt((Failure_time - day * 1440) / 60);
                                    minute = Failure_time - (day * 1440 + hour * 60);
                                    result = "<span>" + day + "天" + hour + "小时" + minute + "分钟</span>";

                                } else if (Failure_time >= 60) {
                                    hour = parseInt(Failure_time / 60);
                                    minute = Failure_time - hour * 60;
                                    result = "<span>" + hour + "小时" + minute + "分钟</span>";
                                }
                                else {
                                    minute = Failure_time;
                                    result = "<span>" + minute + "分钟</span>";
                                }
                                return result;
                            }
                        }, {
                            field: 'ConfirmTime10',
                            title: '确认时长',
                            align: 'center',
                            formatter: function (value, row, index) {
                                var confirm_time = parseInt(row.ConfirmTime10);
                                var result = "";
                                var day = 0;
                                var hour = 0;
                                var minute = 0;

                                if (confirm_time >= 1440) {
                                    day = parseInt(confirm_time / 1440);
                                    hour = parseInt((confirm_time - day * 1440) / 60);
                                    minute = confirm_time - (day * 1440 + hour * 60);
                                    result = "<span>" + day + "天" + hour + "小时" + minute + "分钟</span>";

                                } else if (confirm_time >= 60) {
                                    hour = parseInt(confirm_time / 60);
                                    minute = confirm_time - hour * 60;
                                    result = "<span>" + hour + "小时" + minute + "分钟</span>";
                                }
                                else {
                                    minute = confirm_time;
                                    result = "<span>" + minute + "分钟</span>";
                                }
                                return result;
                            }
                        }, {
                            field: 'FailureCount11',
                            title: '报警数',
                            align: 'center'
                        }, {
                            field: 'DurationMin11',
                            align: 'center',
                            title: '报警时长',
                            formatter: function (value, row, index) {
                                var Failure_time = parseInt(row.DurationMin11);
                                var result = "";
                                var day = 0;
                                var hour = 0;
                                var minute = 0;

                                if (Failure_time >= 1440) {
                                    day = parseInt(Failure_time / 1440);
                                    hour = parseInt((Failure_time - day * 1440) / 60);
                                    minute = Failure_time - (day * 1440 + hour * 60);
                                    result = "<span>" + day + "天" + hour + "小时" + minute + "分钟</span>";

                                } else if (Failure_time >= 60) {
                                    hour = parseInt(Failure_time / 60);
                                    minute = Failure_time - hour * 60;
                                    result = "<span>" + hour + "小时" + minute + "分钟</span>";
                                }
                                else {
                                    minute = Failure_time;
                                    result = "<span>" + minute + "分钟</span>";
                                }
                                return result;
                            }
                        }, {
                            field: 'ConfirmTime11',
                            title: '确认时长',
                            align: 'center',
                            formatter: function (value, row, index) {
                                var confirm_time = parseInt(row.ConfirmTime11);
                                var result = "";
                                var day = 0;
                                var hour = 0;
                                var minute = 0;

                                if (confirm_time >= 1440) {
                                    day = parseInt(confirm_time / 1440);
                                    hour = parseInt((confirm_time - day * 1440) / 60);
                                    minute = confirm_time - (day * 1440 + hour * 60);
                                    result = "<span>" + day + "天" + hour + "小时" + minute + "分钟</span>";

                                } else if (confirm_time >= 60) {
                                    hour = parseInt(confirm_time / 60);
                                    minute = confirm_time - hour * 60;
                                    result = "<span>" + hour + "小时" + minute + "分钟</span>";
                                }
                                else {
                                    minute = confirm_time;
                                    result = "<span>" + minute + "分钟</span>";
                                }
                                return result;
                            }
                        }, {
                            field: 'FailureCount12',
                            title: '报警数',
                            align: 'center'
                        }, {
                            field: 'DurationMin12',
                            align: 'center',
                            title: '报警时长',
                            formatter: function (value, row, index) {
                                var Failure_time = parseInt(row.DurationMin12);
                                var result = "";
                                var day = 0;
                                var hour = 0;
                                var minute = 0;

                                if (Failure_time >= 1440) {
                                    day = parseInt(Failure_time / 1440);
                                    hour = parseInt((Failure_time - day * 1440) / 60);
                                    minute = Failure_time - (day * 1440 + hour * 60);
                                    result = "<span>" + day + "天" + hour + "小时" + minute + "分钟</span>";

                                } else if (Failure_time >= 60) {
                                    hour = parseInt(Failure_time / 60);
                                    minute = Failure_time - hour * 60;
                                    result = "<span>" + hour + "小时" + minute + "分钟</span>";
                                }
                                else {
                                    minute = Failure_time;
                                    result = "<span>" + minute + "分钟</span>";
                                }
                                return result;
                            }
                        }, {
                            field: 'ConfirmTime12',
                            title: '确认时长',
                            align: 'center',
                            formatter: function (value, row, index) {
                                var confirm_time = parseInt(row.ConfirmTime12);
                                var result = "";
                                var day = 0;
                                var hour = 0;
                                var minute = 0;

                                if (confirm_time >= 1440) {
                                    day = parseInt(confirm_time / 1440);
                                    hour = parseInt((confirm_time - day * 1440) / 60);
                                    minute = confirm_time - (day * 1440 + hour * 60);
                                    result = "<span>" + day + "天" + hour + "小时" + minute + "分钟</span>";

                                } else if (confirm_time >= 60) {
                                    hour = parseInt(confirm_time / 60);
                                    minute = confirm_time - hour * 60;
                                    result = "<span>" + hour + "小时" + minute + "分钟</span>";
                                }
                                else {
                                    minute = confirm_time;
                                    result = "<span>" + minute + "分钟</span>";
                                }
                                return result;
                            }
                        }
                    ]
                    ];
                    yui.tableMini("bootstraptable", "/DeviceFailureMonth/List", obj, "POST", "ClientId");
                },
                echartFailureCountL: function () {
                    var _self = this;
                    _self.sourceFailureNumData = [];
                    var data = {
                        datemin: _self.$refs.datemin.value
                    };
                    yui.$axiospostform(_self.url, data).then(function (response) {
                        var res = response.data;
                        _self.sourceFailureNumData.push(['ClientName', '1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月']);
                        if (res.length > 0) {

                            for (var item in res) {
                                _self.sourceFailureNumData.push([
                                    res[item].ClientName,
                                    res[item].FailureCount1,
                                    res[item].FailureCount2,
                                    res[item].FailureCount3,
                                    res[item].FailureCount4,
                                    res[item].FailureCount5,
                                    res[item].FailureCount6,
                                    res[item].FailureCount7,
                                    res[item].FailureCount8,
                                    res[item].FailureCount9,
                                    res[item].FailureCount10,
                                    res[item].FailureCount11,
                                    res[item].FailureCount12
                                ]);
                            }
                        }
                        var echartNum = echarts.init(document.getElementById('failureNum'));
                        var optionNum = {
                            legend: {
                            },
                            tooltip: {},
                            dataset: {
                                source: _self.sourceFailureNumData
                            },
                            xAxis: { type: 'category' },
                            yAxis: { name: '' },
                            series: [
                                { type: 'bar' },
                                { type: 'bar' },
                                { type: 'bar' },
                                { type: 'bar' },
                                { type: 'bar' },
                                { type: 'bar' },
                                { type: 'bar' },
                                { type: 'bar' },
                                { type: 'bar' },
                                { type: 'bar' },
                                { type: 'bar' },
                                { type: 'bar' }
                            ],
                            dataZoom: {
                                type: 'slider',
                                show: true,
                                realtime: true,
                                bottom: -5,
                                height: 20,
                                start: 0,
                                end: 100
                            }
                        };
                        // 使用刚指定的配置项和数据显示图表。
                        echartNum.setOption(optionNum);
                    }).catch(function (error) {
                        console.info(error);
                    })
                },
                echartDurationMinL: function () {
                    var _self = this;
                    _self.sourceDurationMinData = [];
                    var data = {
                        datemin: _self.$refs.datemin.value
                    };
                    yui.$axiospostform(_self.url, data).then(function (response) {
                        var res = response.data;
                        _self.sourceDurationMinData.push(['ClientName', '1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月']);
                        if (res.length > 0) {

                            for (var item in res) {
                                _self.sourceDurationMinData.push([
                                    res[item].ClientName,
                                    res[item].DurationMin1,
                                    res[item].DurationMin2,
                                    res[item].DurationMin3,
                                    res[item].DurationMin4,
                                    res[item].DurationMin5,
                                    res[item].DurationMin6,
                                    res[item].DurationMin7,
                                    res[item].DurationMin8,
                                    res[item].DurationMin9,
                                    res[item].DurationMin10,
                                    res[item].DurationMin11,
                                    res[item].DurationMin12
                                ]);
                            }
                        }
                        var echartTime = echarts.init(document.getElementById('failureTime'));
                        var optionTime = {
                            legend: {
                            },
                            tooltip: {},
                            dataset: {
                                source: _self.sourceDurationMinData
                            },
                            xAxis: { type: 'category' },
                            yAxis: { name: '' },
                            series: [
                                { type: 'bar' },
                                { type: 'bar' },
                                { type: 'bar' },
                                { type: 'bar' },
                                { type: 'bar' },
                                { type: 'bar' },
                                { type: 'bar' },
                                { type: 'bar' },
                                { type: 'bar' },
                                { type: 'bar' },
                                { type: 'bar' },
                                { type: 'bar' }
                            ],
                            dataZoom: {
                                type: 'slider',
                                show: true,
                                realtime: true,
                                bottom: -5,
                                height: 20,
                                start: 0,
                                end: 100
                            }
                        };
                        // 使用刚指定的配置项和数据显示图表。
                        echartTime.setOption(optionTime);
                    }).catch(function (error) {
                        console.info(error);
                    })
                },
                echartConfirmTimeL: function () {
                    var _self = this;
                    _self.sourceConfirmTimeData = [];
                    var data = {
                        datemin: _self.$refs.datemin.value
                    };
                    yui.$axiospostform(_self.url, data).then(function (response) {
                        var res = response.data;
                        _self.sourceConfirmTimeData.push(['ClientName', '1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月']);
                        console.log(res)
                        if (res.length > 0) {

                            for (var item in res) {
                                _self.sourceConfirmTimeData.push([
                                    res[item].ClientName,
                                    res[item].ConfirmTime1,
                                    res[item].ConfirmTime2,
                                    res[item].ConfirmTime3,
                                    res[item].ConfirmTime4,
                                    res[item].ConfirmTime5,
                                    res[item].ConfirmTime6,
                                    res[item].ConfirmTime7,
                                    res[item].ConfirmTime8,
                                    res[item].ConfirmTime9,
                                    res[item].ConfirmTime10,
                                    res[item].ConfirmTime11,
                                    res[item].ConfirmTime12,
                                ]);
                            }
                        }
                        var echartConfirmTime = echarts.init(document.getElementById('confirmTime'));
                        var optionConfirmTime = {
                            legend: {
                            },
                            tooltip: {},
                            dataset: {
                                source: _self.sourceConfirmTimeData
                            },
                            xAxis: { type: 'category' },
                            yAxis: { name: '' },
                            series: [
                                { type: 'bar' },
                                { type: 'bar' },
                                { type: 'bar' },
                                { type: 'bar' },
                                { type: 'bar' },
                                { type: 'bar' },
                                { type: 'bar' },
                                { type: 'bar' },
                                { type: 'bar' },
                                { type: 'bar' },
                                { type: 'bar' },
                                { type: 'bar' }
                            ],
                            dataZoom: {
                                type: 'slider',
                                show: true,
                                realtime: true,
                                bottom: -5,
                                height: 20,
                                start: 0,
                                end: 100
                            }
                        };
                        // 使用刚指定的配置项和数据显示图表。
                        echartConfirmTime.setOption(optionConfirmTime);
                    }).catch(function (error) {
                        console.info(error);
                    })
                },
                searchL: function () {
                    $("#bootstraptable").bootstrapTable('refresh');
                    this.echartFailureCountL();
                    this.echartDurationMinL();
                    this.echartConfirmTimeL();
                }
            }
        });
    </script>
}